﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyCoreLib.Automation.Data.SqlClient.Metadata
{
    public class SqlUserTableTypeMetadata : ISqlDbObjectMetadata
    {
        public readonly string FullName;
        private readonly DataTable Schema;

        public SqlUserTableTypeMetadata(string userTableTypeFullName, DataTable schema)
        {
            FullName = userTableTypeFullName;
            Schema = new DataTable();
            Schema.Merge(schema);
        }

        public DataTable CreateInstance()
        {
            return Schema.Clone();
        }

        string ISqlDbObjectMetadata.FullName
        {
            get { return this.FullName; }
        }

        public override string ToString()
        {
            return FullName;
        }
    }
}
